package com.carter.springframework.beans.factory.config;

import com.carter.springframework.beans.factory.HierarchicalBeanFactory;
import com.carter.springframework.beans.factory.PropertyPlaceholderConfigurer;
import com.carter.springframework.util.StringValueResolver;

/**
 * 可获取 BeanPostProcessor、BeanClassLoader等的一个配置化接口
 */
public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, SingletonBeanRegistry{
    String SCOPE_SINGLETON = "singleton";

    String SCOPE_PROTOTYPE = "prototype";

    /**
     * 添加一个processor
     * @param processor
     */
    void addBeanPostProcessor(BeanPostProcessor processor);

    /**
     * 销毁单例对象
     */
    void destroySingletons();

    /**
     * 添加一个StringValueResolver
     * @param resolver
     */
    void addEmbeddedValueResolver(StringValueResolver resolver);

    /**
     * 处理StringValue
     * @param value
     * @return
     */
    String resolveEmbeddedValue(String value);
}
